home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
internet
/
sweeper
/
samples
/
olecon~1
/
controls
/
template
/
templctl.h
< prev
next >
Wrap
Text File
|
1995-11-25
|
4KB
|
113 lines
//=--------------------------------------------------------------------------=
// <<DEFCONTROLTRUNCNAME>>Ctl.H
//=--------------------------------------------------------------------------=
// Copyright 1995 Microsoft Corporation. All Rights Reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//=--------------------------------------------------------------------------=
//
// class declaration for the <<DEFCONTROLNAME>> control.
//
#ifndef _<<DEFCONTROLNAMECAPS>>CONTROL_H_
#include "IPServer.H"
#include "CtrlObj.H"
#include "<<DEFCONTROLNAME>>Interfaces.H"
#include "Dispids.H"
typedef struct tag<<DEFCONTROLNAMECAPS>>CTLSTATE {
// TOOD: put state variables here, and probably get rid of fGarbage, unless
// you have a real need for it
//
VARIANT_BOOL fGarbage;
} <<DEFCONTROLNAMECAPS>>CTLSTATE;
//=--------------------------------------------------------------------------=
// C<<DEFCONTROLNAME>>Control
//=--------------------------------------------------------------------------=
// our control.
//
class C<<DEFCONTROLNAME>>Control : public COleControl, public I<<DEFCONTROLNAME>>, public ISupportErrorInfo {
public:
// IUnknown methods
//
DECLARE_STANDARD_UNKNOWN();
// IDispatch methods
//
DECLARE_STANDARD_DISPATCH();
// ISupportErrorInfo methods
//
DECLARE_STANDARD_SUPPORTERRORINFO();
// I<<DEFCONTROLNAME>> methods
//
// TODO: copy over the method declarations from <<DEFCONTROLNAME>>Interfaces.H
// don't forget to remove the PURE from them.
//
STDMETHOD_(void, AboutBox)(THIS);
// OLE Control stuff follows:
//
C<<DEFCONTROLNAME>>Control(IUnknown *pUnkOuter);
virtual ~C<<DEFCONTROLNAME>>Control();
// static creation function. all controls must have one of these!
//
static IUnknown *Create(IUnknown *);
private:
// overridables that the control must implement.
//
STDMETHOD(LoadBinaryState)(IStream *pStream);
STDMETHOD(SaveBinaryState)(IStream *pStream);
STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
STDMETHOD(OnDraw)(HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev);
virtual LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
virtual BOOL RegisterClassData(void);
virtual HRESULT InternalQueryInterface(REFIID, void **);
virtual void BeforeCreateWindow(void);
// private state information.
//
<<DEFCONTROLNAMECAPS>>CTLSTATE m_state;
};
// TODO: if you have an array of verbs, then add an extern here with the name
// of it, so that you can include it in the DEFINE_CONTROLOBJECT.
// ie. extern VERBINFO m_<<DEFCONTROLNAME>>CustomVerbs [];
//
extern const GUID *rg<<DEFCONTROLNAME>>PropPages [];
DEFINE_CONTROLOBJECT(<<DEFCONTROLNAME>>,
&CLSID_<<DEFCONTROLNAME>>,
"<<DEFCONTROLNAME>>Ctl",
C<<DEFCONTROLNAME>>Control::Create,
1,
&IID_I<<DEFCONTROLNAME>>,
"<<DEFCONTROLNAME>>.HLP",
&DIID_D<<DEFCONTROLNAME>>Events,
OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
RESID_TOOLBOX_BITMAP,
"<<DEFCONTROLNAME>>WndClass",
1,
rg<<DEFCONTROLNAME>>PropPages,
0,
NULL);
#define _<<DEFCONTROLNAMECAPS>>CONTROL_H_
#endif // _<<DEFCONTROLNAMECAPS>>CONTROL_H_